﻿using System.ComponentModel;
using System.Linq;
using System.Windows;
using Fayshine.VA.Helpers;
using Fayshine.VA.RIAService.Web;
using Fayshine.VA.Controls;
using Fayshine.VA.Models;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System;

namespace Fayshine.VA.Models
{
    public class GatePassengerFlow : INotifyPropertyChanged
    {
        #region Private Fields

        private string m_GateName;
        private int m_InCount;
        private int m_OutCount;
        private int m_Count;
        private DateTime m_DateTime;
        private bool? m_IsIn;

        #endregion

        #region Properties

        public string Name
        {
            get
            {
                return m_GateName;
            }
            set
            {
                m_GateName = value;
                NofityPropertyChanged("Name");
            }
        }

        public int InCount
        {
            get
            {
                return m_InCount;
            }
            set
            {
                m_InCount = value;
                NofityPropertyChanged("InCount");
                NofityPropertyChanged("Count");
            }
        }

        public int OutCount
        {
            get
            {
                return m_OutCount;
            }
            set
            {
                m_OutCount = value;
                NofityPropertyChanged("OutCount");
                NofityPropertyChanged("Count");
            }
        }

        public int Count
        {
            get
            {
                if (IsIn.Value)
                {
                    return m_InCount;
                }
                else
                {
                    return m_OutCount;
                }
            }
        }

        public bool? IsIn
        {
            get
            {
                return m_IsIn;
            }
            set
            {
                m_IsIn = value;
                NofityPropertyChanged("IsIn");
            }
        }

        public DateTime DisplayTime
        {
            get
            {
                return m_DateTime;
            }
            set
            {
                m_DateTime = value;
                NofityPropertyChanged("DisplayTime");
            }
        }

        #endregion

        #region INotifyPropertyChanged Interface

        public event PropertyChangedEventHandler PropertyChanged;
        public void NofityPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
